import Vue from 'vue'
import Vuex from 'vuex'

Vue.use(Vuex)

export default new Vuex.Store({
  state: {
    location:
    {
      "name": "北京",
      "id": "101010100",
      "adm2": "北京",
      "adm1": "北京市",
      "country": "中国",
    },
    hour24: {
      fxTime: [], //x轴数据,xAxisData
      temp: [], //seriesData
    }
  },
  getters: {
  },
  mutations: {
    updateLocation(state, location) {
      state.location = location;
      // Object.assign(state.location, location)
    },
    updateHour24(state, hour24) {
      // state.hour24 = hour24
      Object.assign(state.hour24, hour24)
    }
  },
  actions: {
    updateLocationAction(context, location) {
      context.commit("updateLocation", location)
      
    },
    updateHour24Action(context, hour24) {
      context.commit("updateHour24", hour24)
    }
  },
  modules: {
  
  }
})
